<div class="layui-form-item x-city" id="start">

    <label class="layui-form-label">所在地区</label>
    <div class="layui-input-inline" id="load" style="line-height: 37px">
        加载中...
    </div>

    <div id="select" style="display: none">
        <div class="layui-input-inline">
            <select name="province" lay-filter="province">
                <option value="">请选择省</option>
                {volist name='provinces' id='vo'}
                <option value="{$vo.region_id}">{$vo.region_name}</option>
                {/volist}
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="city" lay-filter="city">
                <option value="">请选择市</option>
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="district" lay-filter="area">
                <option value="">请选择县/区</option>
            </select>
        </div>
        {eq name='type' value='1'}
        <div class="layui-input-inline">
            <select name="street" lay-filter="street">
                <option value="">请选择街道</option>
            </select>
        </div>
        {/eq}
    </div>
</div>


<script>
    var getUrl="{:url('Public/regions')}";
    var provinceList = [];
</script>
<script type="text/javascript" src="/static/admin/js/xcity.js?v=dfg44"></script>
<script>
    layui.use(['form','code'], function(){
        form = layui.form;

        form.render();

        layui.code();

        $.ajax({
            type: "POST",
            url: getUrl,
            data: {},
            dataType:'json',
            success: function (result) {
                provinceList=result;
                $("#load").hide();
                $("#select").show();
                //$('#start').xcity();

                //$('#start').xcity('广东','广州市','东山区');
            },
            error: function (data) {
                console.log(data);
            }

        });
    });
</script>